package com.example.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

public class ExemploImageButton extends Activity implements OnClickListener {
	
	ImageButton bta,btb;
	public void onCreate(Bundle b) {
		super.onCreate(b);
		setContentView(R.layout.exemplo_imagem_button);
		bta = (ImageButton) findViewById(R.id.img1);
		btb = (ImageButton) findViewById(R.id.img2);
		bta.setOnClickListener(this);
		btb.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		if(v == bta) {
			Toast.makeText(this, "Imagem 1 OK", Toast.LENGTH_SHORT).show();
			btb.setVisibility(1);
		}
		if(v == btb) {
			Toast.makeText(this, "Imagem 2 OK", Toast.LENGTH_LONG).show();
			bta.setVisibility(1);
		}
	}
}